package com.sphd.restaurantsystem.presenter;


import com.android.volley.VolleyError;
import com.sphd.restaurantsystem.model.StaffInfoModelImpl;
import com.sphd.restaurantsystem.view.StaffInfoView;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
* Created by Hu on 2016/12/23
*/

public class StaffInfoPresenterImpl implements StaffInfoPresenter{
    StaffInfoView staffInfoView;
    StaffInfoModelImpl staffInfoModel;

    public StaffInfoPresenterImpl(StaffInfoView staffInfoView) {
        this.staffInfoView = staffInfoView;
        staffInfoModel=new StaffInfoModelImpl();
    }

    @Override
    public void addData(String url) {

    }

    @Override
    public void sendError(VolleyError error) {
        staffInfoView.dissLoading();
    }

    @Override
    public void sendMap(String url, Map<String, String> map) {
        staffInfoView.showLoading();
        staffInfoModel.sendMap(url,map,this);
    }

    @Override
    public void sendMapAndFile(String url, String imageName, List<File> fileList, Map<String, String> map) {
        staffInfoView.showLoading();
        staffInfoModel.sendMapAndFile(url, imageName, fileList, map,this);
    }

    @Override
    public void recRes(int res) {
        staffInfoView.recRes(res);
        staffInfoView.dissLoading();
    }
}